/*
 * ChooseBankHolder.java
 * business
 *
 * Created by SunDing on 2017/2/22.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.viewholder;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.yidiandao.business.R;
import com.yidiandao.business.data.bean.PayWay;
import com.yidiandao.business.ui.widget.listview.ViewHolder;

/**
 * 选择开户银行
 * <p>
 * Created by SunDing(dindding@163.com) on 2017/2/22 14:20
 */
public class ChooseBankHolder extends ViewHolder {

    private ImageView mIvLogo;

    private TextView mBankName;

    private ImageView ivSelected;

    @Override
    protected void initView(View rootView) {
        mIvLogo = (ImageView) rootView.findViewById(R.id.iv_pay_way);
        mBankName = (TextView) rootView.findViewById(R.id.tv_pay_way);
        ivSelected = (ImageView) rootView.findViewById(R.id.iv_selected);
    }

    @Override
    protected int getItemLayoutId() {
        return R.layout.item_pay_way;
    }

    public void refreshUI(PayWay payWay) {
        mBankName.setText(payWay.getName());
        ivSelected.setVisibility(payWay.isSelected() ? View.VISIBLE : View.GONE);
    }
}
